<html>
<head>
<title>Constants.ets</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
.s0 { color: #080808;}
.s1 { color: #653170;}
.s2 { color: #e986cd;}
.s3 { color: #870000; font-style: italic;}
.s4 { color: #859801;}
.s5 { color: #ff9170;}
.s6 { color: #6c71c4;}
.ln { color: #adadad; font-weight: normal; font-style: normal; }
</style>
</head>
<body bgcolor="#ffffff">
<table CELLSPACING=0 CELLPADDING=5 COLS=1 WIDTH="100%" BGCOLOR="#c0c0c0" >
<tr><td><center>
<font face="Arial, Helvetica" color="#000000">
Constants.ets</font>
</center></td></tr></table>
<pre><a name="l1"><span class="ln">1    </span></a><span class="s0">import User from </span><span class="s1">&quot;../model/User&quot;</span>
<a name="l2"><span class="ln">2    </span></a>
<a name="l3"><span class="ln">3    </span></a><span class="s0">export default class Constants </span><span class="s2">{</span>
<a name="l4"><span class="ln">4    </span></a>
<a name="l5"><span class="ln">5    </span></a>  <span class="s3">// 启动页等待时常</span>
<a name="l6"><span class="ln">6    </span></a>  <span class="s0">static readonly guideDurationTime</span><span class="s4">:</span><span class="s0">number </span><span class="s4">= </span><span class="s5">1000</span>
<a name="l7"><span class="ln">7    </span></a>
<a name="l8"><span class="ln">8    </span></a>  <span class="s3">// 排行榜页面刷新按钮的颜色</span>
<a name="l9"><span class="ln">9    </span></a>  <span class="s0">static readonly refreshBtnBgc</span><span class="s4">:</span><span class="s0">string </span><span class="s6">[] </span><span class="s4">= </span><span class="s6">[</span>
<a name="l10"><span class="ln">10   </span></a>    <span class="s1">'#ff077def'</span><span class="s4">,</span>
<a name="l11"><span class="ln">11   </span></a>    <span class="s1">'#ff00ff48'</span><span class="s4">,</span>
<a name="l12"><span class="ln">12   </span></a>    <span class="s1">'#ffff01ab'</span><span class="s4">,</span>
<a name="l13"><span class="ln">13   </span></a>    <span class="s1">'#ffe28306'</span><span class="s4">,</span>
<a name="l14"><span class="ln">14   </span></a>    <span class="s1">'#ff000380'</span><span class="s4">,</span>
<a name="l15"><span class="ln">15   </span></a>    <span class="s1">'#ff34643b'</span><span class="s4">,</span>
<a name="l16"><span class="ln">16   </span></a>    <span class="s1">'#ff5900bc'</span><span class="s4">,</span>
<a name="l17"><span class="ln">17   </span></a>    <span class="s1">'#ff016666'</span>
<a name="l18"><span class="ln">18   </span></a>  <span class="s6">]</span>
<a name="l19"><span class="ln">19   </span></a>
<a name="l20"><span class="ln">20   </span></a>  <span class="s3">// app默认名称</span>
<a name="l21"><span class="ln">21   </span></a>  <span class="s0">static readonly defaultUserName</span><span class="s4">:</span><span class="s0">string </span><span class="s4">= </span><span class="s1">'一叶知秋'</span>
<a name="l22"><span class="ln">22   </span></a>  <span class="s0">static readonly defaultPhone</span><span class="s4">:</span><span class="s0">string </span><span class="s4">= </span><span class="s1">'000'</span>
<a name="l23"><span class="ln">23   </span></a>  <span class="s0">static readonly defaultPassword</span><span class="s4">:</span><span class="s0">string </span><span class="s4">= </span><span class="s1">'000'</span>
<a name="l24"><span class="ln">24   </span></a>  <span class="s0">static readonly defaultId</span><span class="s4">:</span><span class="s0">number </span><span class="s4">= </span><span class="s5">0</span>
<a name="l25"><span class="ln">25   </span></a>  <span class="s3">// 未登陆时默认的用户信息</span>
<a name="l26"><span class="ln">26   </span></a>  <span class="s0">static  readonly defaultUser</span><span class="s4">:</span><span class="s0">User </span><span class="s4">=</span><span class="s0">new User</span><span class="s6">(</span><span class="s0">this</span><span class="s4">.</span><span class="s0">defaultUserName</span><span class="s4">,</span><span class="s0">this</span><span class="s4">.</span><span class="s0">defaultPhone</span><span class="s4">,</span><span class="s0">this</span><span class="s4">.</span><span class="s0">defaultPassword</span><span class="s4">,</span><span class="s0">this</span><span class="s4">.</span><span class="s0">defaultId</span><span class="s6">)</span>
<a name="l27"><span class="ln">27   </span></a>
<a name="l28"><span class="ln">28   </span></a>  <span class="s0">static readonly guideBgImageArr</span><span class="s4">: </span><span class="s0">string </span><span class="s6">[] </span><span class="s4">= </span><span class="s6">[</span>
<a name="l29"><span class="ln">29   </span></a>    <span class="s1">'/images/guideBgImage1.jpg'</span><span class="s4">,</span>
<a name="l30"><span class="ln">30   </span></a>    <span class="s1">'/images/guideBgImage2.jpg'</span><span class="s4">,</span>
<a name="l31"><span class="ln">31   </span></a>    <span class="s1">'/images/guideBgImage3.jpg'</span><span class="s4">,</span>
<a name="l32"><span class="ln">32   </span></a>    <span class="s1">'/images/guideBgImage4.jpg'</span><span class="s4">,</span>
<a name="l33"><span class="ln">33   </span></a>    <span class="s1">'/images/guideBgImage5.jpg'</span><span class="s4">,</span>
<a name="l34"><span class="ln">34   </span></a>    <span class="s1">'/images/guideBgImage6.jpg'</span><span class="s4">,</span>
<a name="l35"><span class="ln">35   </span></a>    <span class="s1">'/images/guideBgImage7.jpg'</span>
<a name="l36"><span class="ln">36   </span></a>  <span class="s6">]</span>
<a name="l37"><span class="ln">37   </span></a>  <span class="s3">// 热门诗人区域 诗人的朝代和名字分隔符</span>
<a name="l38"><span class="ln">38   </span></a>  <span class="s0">static readonly separator</span><span class="s4">: </span><span class="s0">string </span><span class="s4">= </span><span class="s1">' · '</span>
<a name="l39"><span class="ln">39   </span></a>  <span class="s3">// 沉浸式</span>
<a name="l40"><span class="ln">40   </span></a>  <span class="s0">static readonly bottomRectHeight</span><span class="s4">: </span><span class="s0">string </span><span class="s4">= </span><span class="s1">'bottomRectHeight'</span>
<a name="l41"><span class="ln">41   </span></a>  <span class="s0">static readonly topRectHeight</span><span class="s4">: </span><span class="s0">string </span><span class="s4">= </span><span class="s1">'topRectHeight'</span>
<a name="l42"><span class="ln">42   </span></a>  <span class="s3">// 用户注册要求</span>
<a name="l43"><span class="ln">43   </span></a>  <span class="s0">static readonly usernameLength</span><span class="s4">: </span><span class="s0">number </span><span class="s4">= </span><span class="s5">3</span>
<a name="l44"><span class="ln">44   </span></a>  <span class="s0">static readonly passwordLength</span><span class="s4">: </span><span class="s0">number </span><span class="s4">= </span><span class="s5">4</span>
<a name="l45"><span class="ln">45   </span></a>  <span class="s3">// api</span>
<a name="l46"><span class="ln">46   </span></a>  <span class="s0">static readonly apiBase</span><span class="s4">: </span><span class="s0">string </span><span class="s4">= </span><span class="s1">'http://113.44.58.22:8081'</span>
<a name="l47"><span class="ln">47   </span></a>  <span class="s0">static readonly regist</span><span class="s4">: </span><span class="s0">string </span><span class="s4">= </span><span class="s0">this</span><span class="s4">.</span><span class="s0">apiBase </span><span class="s4">+ </span><span class="s1">'/user/regist'</span>
<a name="l48"><span class="ln">48   </span></a>  <span class="s0">static readonly login</span><span class="s4">: </span><span class="s0">string </span><span class="s4">= </span><span class="s0">this</span><span class="s4">.</span><span class="s0">apiBase </span><span class="s4">+ </span><span class="s1">'/user/login'</span>
<a name="l49"><span class="ln">49   </span></a>  <span class="s0">static readonly todayPoem</span><span class="s4">: </span><span class="s0">string </span><span class="s4">= </span><span class="s0">this</span><span class="s4">.</span><span class="s0">apiBase </span><span class="s4">+ </span><span class="s1">'/poem/todayPoem'</span>
<a name="l50"><span class="ln">50   </span></a>  <span class="s3">// 当前用户是否收藏过当前诗句 api</span>
<a name="l51"><span class="ln">51   </span></a>  <span class="s0">static readonly isCollectedApi</span><span class="s4">: </span><span class="s0">string </span><span class="s4">= </span><span class="s0">this</span><span class="s4">.</span><span class="s0">apiBase </span><span class="s4">+ </span><span class="s1">'/poem/isCollected'</span>
<a name="l52"><span class="ln">52   </span></a>  <span class="s3">// 取消收藏api</span>
<a name="l53"><span class="ln">53   </span></a>  <span class="s0">static readonly unCollectApi</span><span class="s4">: </span><span class="s0">string </span><span class="s4">= </span><span class="s0">this</span><span class="s4">.</span><span class="s0">apiBase </span><span class="s4">+ </span><span class="s1">'/poem/unCollect'</span>
<a name="l54"><span class="ln">54   </span></a>  <span class="s3">// 收藏api</span>
<a name="l55"><span class="ln">55   </span></a>  <span class="s0">static readonly collectApi</span><span class="s4">: </span><span class="s0">string </span><span class="s4">= </span><span class="s0">this</span><span class="s4">.</span><span class="s0">apiBase </span><span class="s4">+ </span><span class="s1">'/poem/collect'</span>
<a name="l56"><span class="ln">56   </span></a>  <span class="s3">// 查询我的收藏</span>
<a name="l57"><span class="ln">57   </span></a>  <span class="s0">static readonly myCollectApi</span><span class="s4">: </span><span class="s0">string </span><span class="s4">= </span><span class="s0">this</span><span class="s4">.</span><span class="s0">apiBase </span><span class="s4">+ </span><span class="s1">'/poem/myCollect'</span>
<a name="l58"><span class="ln">58   </span></a>  <span class="s3">// 清空我的收藏</span>
<a name="l59"><span class="ln">59   </span></a>  <span class="s0">static readonly clearCollectApi</span><span class="s4">: </span><span class="s0">string </span><span class="s4">= </span><span class="s0">this</span><span class="s4">.</span><span class="s0">apiBase </span><span class="s4">+ </span><span class="s1">'/poem/clearCollect'</span>
<a name="l60"><span class="ln">60   </span></a>  <span class="s3">// 收藏榜</span>
<a name="l61"><span class="ln">61   </span></a>  <span class="s0">static readonly collectRankApi</span><span class="s4">: </span><span class="s0">string </span><span class="s4">= </span><span class="s0">this</span><span class="s4">.</span><span class="s0">apiBase </span><span class="s4">+ </span><span class="s1">'/poem/collectRank'</span>
<a name="l62"><span class="ln">62   </span></a>
<a name="l63"><span class="ln">63   </span></a>
<a name="l64"><span class="ln">64   </span></a>  <span class="s3">// 持久化</span>
<a name="l65"><span class="ln">65   </span></a>  <span class="s3">// 首选项的 文件(数据库)名称</span>
<a name="l66"><span class="ln">66   </span></a>  <span class="s0">static readonly PREFERENCES_OneAutumn</span><span class="s4">:</span><span class="s0">string </span><span class="s4">= </span><span class="s1">&quot;OneAutumn&quot;</span>
<a name="l67"><span class="ln">67   </span></a>
<a name="l68"><span class="ln">68   </span></a>  <span class="s3">// 存储当前登录用户时候的key</span>
<a name="l69"><span class="ln">69   </span></a>  <span class="s0">static readonly currentUser</span><span class="s4">:</span><span class="s0">string </span><span class="s4">= </span><span class="s1">&quot;currentUser&quot;</span>
<a name="l70"><span class="ln">70   </span></a>
<a name="l71"><span class="ln">71   </span></a>  <span class="s3">// 存储收藏诗词的id数组</span>
<a name="l72"><span class="ln">72   </span></a>  <span class="s0">static readonly collectPoemIdArr</span><span class="s4">:</span><span class="s0">string </span><span class="s4">=</span><span class="s1">'collectPoemIdArr'</span>
<a name="l73"><span class="ln">73   </span></a>
<a name="l74"><span class="ln">74   </span></a>
<a name="l75"><span class="ln">75   </span></a>
<a name="l76"><span class="ln">76   </span></a><span class="s2">}</span></pre>
</body>
</html>